<!--
 * @Author: LBH 1336709799@qq.com
 * @Date: 2024-12-13 23:00:13
 * @LastEditors: LBH 1336709799@qq.com
 * @LastEditTime: 2024-12-13 23:00:25
 * @FilePath: \hm-admin\src\layouts\components\AuthBtn.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script lang="ts" setup>
import { useUserStore } from '@/stores/user';
import { computed, useSlots } from 'vue';


const props = withDefaults(defineProps<{
  btnPerm?: string
}>(), {
  btnPerm: ''
})

const isShow = computed(()=>{
  const store = useUserStore()
  const perms = store.profile.permissions
  return perms.includes(props.btnPerm) || perms.includes('*:*:*')
})

</script>

<template>
  <slot v-if="isShow"></slot>
  <span v-else></span>
</template>